package com.priserve.retirement.entities;

// Generated Apr 27, 2013 9:50:19 PM by Hibernate Tools 4.0.0

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Home object for domain model class Dependentinformation.
 * @see com.priserve.retirement.entities.Dependentinformation
 * @author Hibernate Tools
 */
@Stateless
public class DependentinformationHome {

	private static final Log log = LogFactory
			.getLog(DependentinformationHome.class);

	@PersistenceContext
	private EntityManager entityManager;

	public void persist(Dependentinformation transientInstance) {
		log.debug("persisting Dependentinformation instance");
		try {
			entityManager.persist(transientInstance);
			log.debug("persist successful");
		} catch (RuntimeException re) {
			log.error("persist failed", re);
			throw re;
		}
	}

	public void remove(Dependentinformation persistentInstance) {
		log.debug("removing Dependentinformation instance");
		try {
			entityManager.remove(persistentInstance);
			log.debug("remove successful");
		} catch (RuntimeException re) {
			log.error("remove failed", re);
			throw re;
		}
	}

	public Dependentinformation merge(Dependentinformation detachedInstance) {
		log.debug("merging Dependentinformation instance");
		try {
			Dependentinformation result = entityManager.merge(detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public Dependentinformation findById(Long id) {
		log.debug("getting Dependentinformation instance with id: " + id);
		try {
			Dependentinformation instance = entityManager.find(
					Dependentinformation.class, id);
			log.debug("get successful");
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}
}
